.mod-monitor.monitor-manage
	loading(ng-if="loadingsIns.isLoading")
	.monitor-options
		.monitor-option
			span.option-title 集群
			.com-select-con(select-con)
				button.ui-btn.ui-btn-white.ui-btn-select(ng-cloak) {{clusterListIns.cluster.name}}
					i.icon-down
				ul.select-list
					li.select-item(ng-repeat="cluster in clusterListIns.clusterList")
						a(ng-bind="cluster.name" ng-click="toggleCluster($index)")
		.monitor-option
			span.option-title 监控类型
			.com-select-con(select-con)
				button.ui-btn.ui-btn-white.ui-btn-select(ng-cloak) {{monitorType}}
					i.icon-down
				ul.select-list
					li.select-item
						a(ng-click="toggleMonitorType('实例')") 实例
					li.select-item
						a(ng-click="toggleMonitorType('主机')") 主机
		.monitor-option
			span.option-title 环境
			.com-select-con(select-con)
				button.ui-btn.ui-btn-white.ui-btn-select(ng-cloak ng-disabled="loadingsIns.loadingItems.deploy") {{currentEnv.text}}
					i.icon-down
				ul.select-list
					li.select-item
						a(ng-click="toggleEnv('生产')") 生产 
					li.select-item
						a(ng-click="toggleEnv('测试')") 测试
		.monitor-option(ng-if="monitorType=='实例'")
			span.option-title 部署
			.com-select-con(select-con)
				button.ui-btn.ui-btn-white.ui-btn-select(ng-cloak) {{deployListIns.deploy.name||'选择部署'}}
					i.icon-down
				ul.select-list
					li.select-item(ng-if="!deployListIns.deployList||deployFiltered.length===0")
						a 无相关部署
					li.select-item(ng-repeat="deploy in deployFiltered=(deployListIns.deployList|filter:{'clusterFilter':true,'hostEnv':currentEnv.value})")
						a(ng-bind="deploy.deployName" ng-click="toggleDeploy(deploy.deployId,deploy.deployName)")
		.monitor-line(ng-if="monitorType=='主机'")
			span.option-title 主机标签
			.ui-input-white.com-select-con.host-label(label="true" select-con)
				ul.selected-labels
					li.select-label(ng-repeat="(label,value) in nodeListIns.labelsInfo|search:'isShow':true|search:'isSelected':true" ng-cloak)
						| {{label}}
						a.icon-cancel(ng-click="nodeListIns.toggleLabel(label,false)")
					li.select-input
						input.line-element.ui-btn-select(placeholder="选择主机标签" ng-model="labelKey.key" ng-keydown="labelKeyDown($event,labelKey.key,labelsInfoFiltered)")
				ul.select-list
					li(ng-if="objLength(labelsInfoFiltered)===0")
						a 无相关信息
					li.select-item(ng-repeat="(label,value) in labelsInfoFiltered=(nodeListIns.labelsInfo| searchKey:labelKey.key|search:'isShow':true)")
						a(ng-bind="label" ng-click="nodeListIns.toggleLabel(label,true);labelKey.key=''")
	.monitor-info(ng-if="monitorType=='主机'")
		span.selected-count 已选中{{nodeListIns.selectedCount}}个
		a.ui-btn.ui-btn-primary.ui-btn-link.ui-btn-sm(target="_blank" ng-click="toMonitorDetail('node')") 查看监控详情
		.pull-right
			| 共{{nodeListIns.nodeList.length||0}}台主机
			input.ui-input-fill.ui-input-search(placeholder="输入主机名称查询" ng-model="keywords.node" ng-change="nodeListIns.filterWithKey(keywords.node)")
	.monitor-info(ng-if="monitorType=='实例'")
		span.selected-count 已选中{{deployListIns.deployInstanceListIns.selectedCount}}个
		a.ui-btn.ui-btn-primary.ui-btn-link.ui-btn-sm(target="_blank" ng-click="toMonitorDetail('pod')") 查看监控详情
		.pull-right
			| 共{{deployListIns.deployInstanceListIns.instanceList.length||0}}个实例
			input.ui-input-fill.ui-input-search(placeholder="输入实例名称查询" ng-model="keywords.instance" ng-change="deployListIns.deployInstanceListIns.filterWithKey(keywords.instance)")
	.mod-list
		table.ui-table-dome(ng-if="monitorType=='主机'")
			thead(ondragstart="return false" onselectstart="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false")
				tr
					th
						span
							input.ui-check#checkAllNode(type="checkbox" ng-model="nodeListIns.isCheckAll" ng-change="nodeListIns.checkAllNode()")
							label(for="checkAllNode")
						| 主机
					th 状态
					th.tool-enable-click(ng-click="toggleOrderBy('node','cpuBusyCount')" ng-class="{'active':orderBy.node=='cpuBusyCount'}") CPU占用
						i.icon-order(ng-show="orderBy.node!='cpuBusyCount'")
						i.icon-down(ng-show="orderBy.node=='cpuBusyCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('node','memPercentCount')" ng-class="{'active':orderBy.node=='memPercentCount'}") 内存占用
						i.icon-order(ng-show="orderBy.node!='memPercentCount'")
						i.icon-down(ng-show="orderBy.node=='memPercentCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('node','diskUsedCount')" ng-class="{'active':orderBy.node=='diskUsedCount'}") 磁盘最大占用
						i.icon-order(ng-show="orderBy.node!='diskUsedCount'")
						i.icon-down(ng-show="orderBy.node=='diskUsedCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('node','diskReadCount')" ng-class="{'active':orderBy.node=='diskReadCount'}") 磁盘读总量(KB/s)
						i.icon-order(ng-show="orderBy.node!='diskReadCount'")
						i.icon-down(ng-show="orderBy.node=='diskReadCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('node','diskWriteCount')" ng-class="{'active':orderBy.node=='diskWriteCount'}") 磁盘写总量(KB/s)
						i.icon-order(ng-show="orderBy.node!='diskWriteCount'")
						i.icon-down(ng-show="orderBy.node=='diskWriteCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('node','netInCount')" ng-class="{'active':orderBy.node=='netInCount'}") 网络流入总量(KB/s)
						i.icon-order(ng-show="orderBy.node!='netInCount'")
						i.icon-down(ng-show="orderBy.node=='netInCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('node','netOutCount')" ng-class="{'active':orderBy.node=='netOutCount'}") 网络流出总量(KB/s)
						i.icon-order(ng-show="orderBy.node!='netOutCount'")
						i.icon-down(ng-show="orderBy.node=='netOutCount'" ng-class="{'up':!orderBy.isReverse}")
			tbody
				tr(ng-if="!nodeListIns.nodeList||filteredNodes.length===0")
					td(colspan="9") 无主机信息
				tr(ng-repeat="node in filteredNodes=(nodeListIns.nodeList|filter:{'labelFilter':true,'keyFilter':true}|orderBy:orderBy.node:orderBy.isReverse)")
					td(ng-cloak)
						span
							input.ui-check(id="{{'node'+$index}}" type="checkbox" ng-model="node.isSelected" ng-change="nodeListIns.toggleNodeCheck(node)")
							label(for="{{'node'+$index}}")
						a(target="_blank" ng-click="toMonitorDetail('node',node)") {{node.name}}
					td(ng-if="node.status=='Ready'").txt-safe 在线
					td(ng-if="node.status=='NotReady'").txt-prompt 离线
					td(ng-cloak) {{isNaN(node.cpuBusyCount)?node.cpuBusyCount:(node.cpuBusyCount+'%')}}
					td(ng-cloak) {{isNaN(node.memPercentCount)?node.memPercentCount:(node.memPercentCount+'%')}}
					td
						a.link-tooltip(ng-mouseenter="modifyTooltip('diskUsed',node.diskUsedData)" tooltip-template="'detailTooltip.html'" tooltip-placement="left" ng-cloak) {{isNaN(node.diskUsedCount)?node.diskUsedCount:(node.diskUsedCount+'%')}}
					td
						a.link-tooltip(ng-bind="node.diskReadCount" ng-mouseenter="modifyTooltip('diskRead',node.diskReadData)" tooltip-template="'detailTooltip.html'" tooltip-placement="left")
					td
						a(ng-bind="node.diskWriteCount" ng-mouseenter="modifyTooltip('diskWrite',node.diskWriteData)" tooltip-template="'detailTooltip.html'" tooltip-placement="left")
					td
						a(ng-bind="node.netInCount" ng-mouseenter="modifyTooltip('netIn',node.netInData)" tooltip-template="'detailTooltip.html'" tooltip-placement="left")
					td
						a(ng-bind="node.netOutCount" ng-mouseenter="modifyTooltip('netOut',node.netOutData)" tooltip-template="'detailTooltip.html'" tooltip-placement="left")
		table.ui-table-dome(ng-if="monitorType=='实例'")
			thead(ondragstart="return false" onselectstart="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false")
				tr
					th
						span
							input.ui-check#checkAllInstance(type="checkbox" ng-model="deployListIns.deployInstanceListIns.isCheckAll" ng-change="deployListIns.deployInstanceListIns.checkAllInstance()")
							label(for="checkAllInstance")
						| 实例
					th.tool-enable-click(ng-click="toggleOrderBy('pod','cpuBusyCount')" ng-class="{'active':orderBy.pod=='cpuBusyCount'}") CPU占用
						i.icon-order(ng-show="orderBy.pod!='cpuBusyCount'")
						i.icon-down(ng-show="orderBy.pod=='cpuBusyCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('pod','memPercentCount')" ng-class="{'active':orderBy.pod=='memPercentCount'}") 内存占用
						i.icon-order(ng-show="orderBy.pod!='memPercentCount'")
						i.icon-down(ng-show="orderBy.pod=='memPercentCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('pod','netInCount')" ng-class="{'active':orderBy.pod=='netInCount'}") 网络流入总量(KB/s)
						i.icon-order(ng-show="orderBy.pod!='netInCount'")
						i.icon-down(ng-show="orderBy.pod=='netInCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('pod','netOutCount')" ng-class="{'active':orderBy.pod=='netOutCount'}") 网络流出总量(KB/s)
						i.icon-order(ng-show="orderBy.pod!='netOutCount'")
						i.icon-down(ng-show="orderBy.pod=='netOutCount'" ng-class="{'up':!orderBy.isReverse}")
					th 容器
			tbody
				tr(ng-if="!deployListIns.deployInstanceListIns.instanceList||instanceListFiltered.length===0")
					td(colspan="6") 无实例信息
				tr(ng-repeat="instance in instanceListFiltered = (deployListIns.deployInstanceListIns.instanceList|filter:{keyFilter:true}|orderBy:orderBy.pod:orderBy.isReverse)")
					td(ng-cloak)
						span
							input.ui-check(id="{{'instance'+$index}}" type="checkbox" ng-model="instance.isSelected" ng-change="deployListIns.deployInstanceListIns.toggleCheck(instance)")
							label(for="{{'instance'+$index}}")
						a(ng-click="toMonitorDetail('pod',instance)") {{instance.instanceName}}
					td(ng-cloak) {{isNaN(instance.cpuBusyCount)?instance.cpuBusyCount:(instance.cpuBusyCount+'%')}}
					td(ng-cloak) {{isNaN(instance.memPercentCount)?instance.memPercentCount:(instance.memPercentCount+'%')}}
					td(ng-bind="instance.netInCount")
					td(ng-bind="instance.netOutCount")
					td
						a.link-safe(ng-click="showContainer(instance)") 查看
script(type="text/ng-template" id="detailTooltip.html")
	div(ng-bind-html="toolTipText")
script(type="text/ng-template" id="containersModal.html")
	.d-modal-header
		| 查看容器
	.d-modal-full.mod-monitor
		table.ui-table-dome
			thead(ondragstart="return false" onselectstart="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false")
				tr
					th 容器ID
					th 镜像名称
					th 镜像版本
					th.tool-enable-click(ng-click="toggleOrderBy('cpuBusyCount')" ng-class="{'active':orderBy.container=='cpuBusyCount'}") CPU占用
						i.icon-order(ng-show="orderBy.container!='cpuBusyCount'")
						i.icon-down(ng-show="orderBy.container=='cpuBusyCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('memPercentCount')" ng-class="{'active':orderBy.container=='memPercentCount'}") 内存占用
						i.icon-order(ng-show="orderBy.container!='memPercentCount'")
						i.icon-down(ng-show="orderBy.container=='memPercentCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('netInCount')" ng-class="{'active':orderBy.container=='netInCount'}") 网络流入总量(KB/s)
						i.icon-order(ng-show="orderBy.container!='netInCount'")
						i.icon-down(ng-show="orderBy.container=='netInCount'" ng-class="{'up':!orderBy.isReverse}")
					th.tool-enable-click(ng-click="toggleOrderBy('netOutCount')" ng-class="{'active':orderBy.container=='netOutCount'}") 网络流出总量(KB/s)
						i.icon-order(ng-show="orderBy.container!='netOutCount'")
						i.icon-down(ng-show="orderBy.container=='netOutCount'" ng-class="{'up':!orderBy.isReverse}")
			tbody
				tr(ng-if="instanceIns.containerList.length===0")
					td 无Container信息
				tr(ng-repeat="container in instanceIns.containerList|orderBy:orderBy.container:orderBy.isReverse")
					td.container-name(ng-cloak)
						a.ui-table-link(ng-click="toMonitorDetail(container)") {{container.shortContainerId}}
					td.container-image(ng-bind="container.image")
					td(ng-bind="container.imageTag")
					td(ng-cloak) {{isNaN(container.cpuBusyCount)?container.cpuBusyCount:(container.cpuBusyCount+'%')}}
					td(ng-cloak) {{isNaN(container.memPercentCount)?container.memPercentCount:(container.memPercentCount+'%')}}
					td(ng-bind="container.netInCount")
					td(ng-bind="container.netOutCount")
	.d-modal-footer
		a.ui-btn.ui-btn-primary.ui-btn-sm.ui-btn-link.pull-right(href="" target="_blank" ng-click="toMonitorDetail()") 查看监控详情